﻿//------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
using Microsoft.Office.Interop.PowerPoint;

using OfficeSWORD.Common;

namespace PowerPointSWORD
{
    public partial class RibbonSWORD : OfficeRibbon
    {
        public RibbonSWORD()
        {
            InitializeComponent();
        }

        private void RibbonSWORD_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void buttonSwordDeposit_Click(object sender, RibbonControlEventArgs e)
        {
            Presentation doc = ThisAddIn.PowerPointApplication.ActivePresentation;

            // File must be saved.
            // TODO If there are changes since it was last saved, we should ask the user to confirm
            doc.Save();

            DepositForm deposit = new DepositForm(this.editBoxSwordEndpoint.Text, doc.FullName);
            deposit.ShowDialog();
        }
    }
}
